<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
            position: absolute;
        }
    </style>
</head>
<body>
    <img src="/Users/D盘/JavaScript练习/picture/IMG_3903.GIF" alt="">
    <script>
        document.addEventListener('mousemove',function(e){
            var pic =document.querySelector('img');
            var x = e.pageX;
            var y = e.pageY;
            pic.style.left = x - 150 + 'px';
            pic.style.top = y - 150 + 'px';
        })
    </script>
</body>
</html>